package com.niiwoo.civet.scheduler.trigger;

import com.alibaba.dubbo.config.annotation.Reference;
import com.niiwoo.civet.account.service.WithdrawDubboService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 提现补单定时任务
 * Created by wangjichao on 2017/12/14.
 */
@Component
@Slf4j
public class WithdrawJobTrigger {
    @Reference(version = "1.0.0")
    private WithdrawDubboService withdrawDubboService;

    /**
     * 提现预提交阶段补单定时任务
     */
    @Scheduled(cron = "${withdraw.withdraw-pre-submission}")
    public void withdrawPreSubmissionJob(){
        log.info("==========withdrawPreSubmissionJob invoke==========");
        withdrawDubboService.withdrawPreSubmissionJob();
    }

    /**
     * 提现成功失败补单定时任务
     */
    @Scheduled(cron = "${withdraw.withdraw-success-failure-t0}")
    public void withdrawSuccessFailureJobT0(){
        log.info("==========withdrawSuccessFailureJobT0 invoke==========");
        withdrawDubboService.withdrawSuccessFailureJobT0();
    }

    /**
     * 提现成功失败补单定时任务
     */
    @Scheduled(cron = "${withdraw.withdraw-success-failure-t1}")
    public void withdrawSuccessFailureJobT1(){
        log.info("==========withdrawSuccessFailureJobT1 invoke==========");
        withdrawDubboService.withdrawSuccessFailureJobT1();
    }

    /**
     * 提现确认提现取消定时任务
     */
    @Scheduled(cron = "${withdraw.withdraw-confirm-cancel}")
    public void withdrawConfirmCancel(){
        log.info("==========withdrawConfirmCancelJob invoke==========");
        withdrawDubboService.withdrawConfirmCancelJob();
    }

}
